<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Cart extends Model  {

	/**
	 * The database table used by the model.
	 *
	 * @var string
	 */
	protected $table = 'cart';
	protected $primaryKey  ='rec_id';

    /**
     * Indicates if the model should be timestamped.
     *
     * @var bool
     */
    public $timestamps = false;

    /**
     * Indicates if the primary key should be incrementing.
     *
     * @var bool
     */
    //protected $incrementing =false;

    /**
     * The storage format of the model's date columns.
     *
     * @var string
     */
    //protected $dateFormat = 'U';

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    //protected $fillable = ['name'];

    /**
     * The attributes that aren't mass assignable.
     *
     * @var array
     */
    //protected $guarded = ['price'];


    //use SoftDeletes;

    /**
     * The attributes that should be mutated to dates.
     *
     * @var array
     */
    //protected $dates = ['deleted_at'];

    /**
     * The attributes excluded from the model's JSON form.
     *
     * @var array
     */
    protected $hidden = array('store_id');

    /**
     * The cart that belong to the store..
     */
    public function store()
    {
        return $this->belongsTo('App\Models\Store','store_id','store_id');
    }

    public function goods()
    {
        return $this->belongsTo('App\Models\Goods','goods_id','goods_id');
    }

    public function goodsSpec()
    {
        return $this->belongsTo('App\Models\GoodsSpec','spec_id','spec_id');
    }
}
